package main

import "fmt"

func main() {
	var c Calculator
	cal := c.cal(23.9, 33.8, '*')
	fmt.Println("res=", cal)

}

type Calculator struct {
}

func (c Calculator) cal(n1 float64, n2 float64, ca byte) float64 {
	switch ca {
	case '+':
		return n1 + n2
	case '-':
		return n1 - n2
	case '*':
		return n1 * n2
	case '/':
		return n1 / n2
	default:
		panic("符号错误")
	}

}
